/*!
 @header LcbLog.h
 @abstract 日志操作
 @author 刘成彬
 @version 1.0 2016/05/23 Creation
 */

#import <Foundation/Foundation.h>
#import "LcbSingleton.h"

#define LOGGER_INFO(fmt, ...) ([LcbLog info:(@"\n[文件名:%s]\n" "[函数名:%s]\n" "[行号:%d] \n" fmt), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__])
#define LOGGER_WARN(fmt, ...) ([LcbLog warn:(@"\n[文件名:%s]\n" "[函数名:%s]\n" "[行号:%d] \n" fmt), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__])
#define LOGGER_ERROR(fmt, ...) ([LcbLog error:(@"\n[文件名:%s]\n" "[函数名:%s]\n" "[行号:%d] \n" fmt), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__])
#define LOGGER_CRASH(fmt, ...) ([LcbLog crash:(@"\n[文件名:%s]\n" "[函数名:%s]\n" "[行号:%d] \n" fmt), __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__])

typedef enum
{
    LogLevelNone = 0,
    LogLevelCrash,
    LogLevelError,
    LevelWarning,
    LevelInfo
}LogLevel;
/*!
 @class
 @abstract 日志类。
 */
@interface LcbLog : NSObject
LcbSingletonH(LcbLog)
+(void)setLoglevel:(LogLevel)Loglevel;
+(void)setSaveLogToDisk:(BOOL)saveLogToDisk;
+ (void)log:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
+ (void)info:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
+ (void)warn:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
+ (void)error:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);
+ (void)crash:(NSString *)format, ... NS_FORMAT_FUNCTION(1,2);

+ (void)log:(NSString *)format args:(va_list)argList;
+ (void)info:(NSString *)format args:(va_list)argList;
+ (void)warn:(NSString *)format args:(va_list)argList;
+ (void)error:(NSString *)format args:(va_list)argList;
+ (void)crash:(NSString *)format args:(va_list)argList;

+ (void)clear;
@end
